package com.voute.View.Adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.voute.Model.Bean.RecommendCirclesEntity;
import com.voute.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by liucxu on 2017/4/27.
 */

public class RecommendCircleAdapter extends BaseAdapter {

    private List<RecommendCirclesEntity> circles = new ArrayList<>();
    private Context mContext;

    public RecommendCircleAdapter(Context c, List<RecommendCirclesEntity> sources) {
        mContext = c;
        if (sources != null) {
            circles.clear();
            circles.addAll(sources);
        }
    }

    @Override
    public int getCount() {
        return circles.size();
    }

    @Override
    public Object getItem(int i) {
        return circles.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View convert_view, ViewGroup viewGroup) {
        if(convert_view==null){
            convert_view=View.inflate(mContext, R.layout.adapter_comment_linearlayout,null);
        }
        return convert_view;
    }
}
